<?php

class Ialbum_Widget_MostCommentPhotosController extends Engine_Content_Widget_Abstract
{
  public function indexAction()
  {
	$this->view->paginator = $paginator =  Engine_Api::_()->getApi('photo', 'ialbum')->getPhotoPaginator(array('order'=>'comment_count DESC'));
    $paginator->setItemCountPerPage($this->_getParam('itemCountPerPage', 12));
    $paginator->setCurrentPageNumber($this->_getParam('page', 1));
	if ($paginator->getTotalItemCount() <= 0) return $this->setNoRender();
  }
}